<template >
	<div>
		<slot />
	</div>
</template>
<script>
import mixin from "./mixin";
import { generate } from "../utils/generator";
export default {
	name: "EntityPolygon",
	mixins: [mixin],
	data() {
		this.entityType = "polygon";
		return {};
	},
	methods: {
		zoomTo() {
			const viewer = this.$parent.viewer;
			if (!this.properties?.hierarchy?.positions.length) return;
			if (this.zoomOffset) {
				viewer.zoomTo(this.entity, generate(this.zoomOffset));
				return;
			}
			viewer.zoomTo(this.entity);
		}
	}
};
</script>